package com.yonyou.pmclouds.measureindex.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.measureindex.entity.MeasureIndexRefVO;
import com.yonyou.pmclouds.measureindex.entity.MeasureIndexVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface MeasureIndexMapper extends BaseMapper<MeasureIndexVO> {

    MeasureIndexVO[] selectMeasureIndexByPage(@Param("timestamp") String timestamp,
                                            @Param("keywords") String[] keywords,
                                            @Param("start") int start,
                                            @Param("size") int size,
                                            @Param("enableStatus") int enableStatus,
                                              @Param("pkTenant") String pkTenant);

    int  countMeasureIndexByTimeStamp(@Param("timestamp") String timestamp,
                                      @Param("keywords") String[] keywords,
                                      @Param("enableStatus") int enableStatus,
                                      @Param("pkTenant") String pkTenant);

    int countCode(@Param("code") String code,@Param("pkTenant") String pkTenant);
    int countName(@Param("name") String name,@Param("pkTenant") String pkTenant);

    List<MeasureIndexRefVO> indexRefQuery(@Param("pkTenant") String pkTenant, @Param("keyword") String keyword);

    List<MeasureIndexVO> queryByPks(@Param("pks") String[] pks);

    /**
     * @des  通过名字和编码联合查询所有的数据
     * @param codes
     * @param names
     * @return
     */
    MeasureIndexVO[] queryMeasureIndexByNameAndCode(@Param("codes") Set<String> codes,
                                                    @Param("names") Set<String> names,@Param("pkTenant") String pkTenant);
}
